<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

//
$app->get('/me/info', 'UserController@refreshMyInfo');
$app->post('/me/info', 'UserController@updateMyInfo');
$app->post('/me/avatar', 'UserController@updateMyAvatar');

$app->get('/me/appointments/received', 'UserController@showMyReceivedAppointments');
$app->get('/me/appointments/sent', 'UserController@showMySentAppointments');

$app->get('/user/{user_uuid}', 'UserController@showUser');

//
$app->get('/book/{book_uuid}', 'BookController@showBook');

$app->post('/book/fly', 'BookController@createBook');
$app->post('/book/edit', 'BookController@editBook');
$app->post('/book/delete', 'BookController@deleteBook');

//$app->get('/books/nearby', 'BookController@nearbyBooks');

$app->post('/place/add', 'PlaceController@addPlace');

$app->post('/place/delete', 'PlaceController@deletePlace');

//
$app->post('/appointment/handle', 'AppointmentController@handleAppointment');





//**** wechat xcx

$app->get('wx/user/{user_uuid}', 'WxController@showUser');

$app->get('/wx/mobile/unbind', 'WxController@unbindMobile');

$app->post('/wx/letter/send', 'LetterController@createLetter');
$app->post('/wx/letter/recall', 'LetterController@recallLetter');
$app->post('/wx/letter/pass', 'LetterController@passLetter');
$app->post('/wx/letter/read', 'LetterController@readLetter');

$app->get('/wx/letter/show', 'LetterController@showLetter');

$app->get('/wx/letter/karma', 'LetterController@karmaLetter');

$app->get('/wx/letters/inbox', 'LetterController@listInboxLetters');


$app->get('wx/me/info', 'UserController@refreshMyInfo');
$app->post('wx/me/info', 'UserController@updateMyInfo');

$app->post('wx/me/avatar', 'UserController@updateMyAvatar');

$app->get('wx/me/appointments/received', 'UserController@showMyReceivedAppointments');
$app->get('wx/me/appointments/sent', 'UserController@showMySentAppointments');

$app->post('wx/book/fly', 'BookController@createBook');
$app->post('wx/book/edit', 'BookController@editBook');
$app->post('wx/book/delete', 'BookController@deleteBook');

$app->get('wx/book/code/{book_uuid}', 'BookController@showBookCode');

$app->post('wx/appointment/handle', 'AppointmentController@handleAppointment');



